package com.heima.article.service.impl;

import com.heima.article.service.ApArticleBehaviorService;
import com.heima.model.behavior.dtos.BehaviorDto;
import com.heima.model.behavior.vos.BehaviorArticleDataVo;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ApArticleBehaviorServiceImpl implements ApArticleBehaviorService {

    /**
     * 文章收藏
     * @param dto
     * @return
     */
    @Override
    public ResponseResult collection(BehaviorDto dto) {

        //TODO: Redis存储文章收藏数据

        return ResponseResult.okResult(200, "文章收藏");
    }

    /**
     * 数据回显
     * @param dto
     * @return
     */
    @Override
    public ResponseResult loadData(BehaviorDto dto) {

        //TODO: 回显Redis文章数据

        BehaviorArticleDataVo vo = new BehaviorArticleDataVo();
        vo.setIscollection(false);
        vo.setIsfollow(false);
        vo.setIslike(false);
        vo.setIsunlike(false);

        return ResponseResult.okResult(vo);
    }
}
